<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of admins
 *
 * @author Maulnick
 */
class admins extends CI_Model {
    //put your code here
    function __construct() {
        parent::__construct();
        $this->load->database();
    }
    function validate()
    {
        
        $this->db->where('username', $this->input->post('username'));
        $this->db->where('password', md5($this->input->post('password')));
        $query = $this->db->get('admin');
        if($query->num_rows == 1)
        {
            return $query->row(0)->idadmin;
        }else{
            return false;
        }
		
    }
    function add_article(){
        // insert table artikel
        
        
        // get idartikel from table artikel
        
        // insert table kategor_artikel
    }
    function insert_article(){
        // insert table artikel
        
        
        // get idartikel from table artikel
        
        // insert table kategor_artikel
    }
    function delete_article(){
        
    }
}

?>
